home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
034a
/
twview82.zip
/
EDITBASE.INC
< prev
next >
Wrap
Text File
|
1991-02-04
|
3KB
|
106 lines
procedure MakePort( var update : boolean );
var
s : SectorIndex;
pt : integer;
begin
write('Make a port out of which ');
s := GetSector;
if s <> 0 then
if space.sectors[ s ].portType <> NotAPort then
writeln( s, ' is already a port!')
else
begin
repeat
writeln('Describe this port:');
writeln(' 0 : Buy all products');
writeln(' 1 : Sell Fuel Ore; buy Organics and Equipment');
writeln(' 2 : Sell Organics; buy Fuel Ore and Equipment');
writeln(' 3 : Sell Fuel Ore and Organics; buy Equipment');
writeln(' 4 : Sell Equipment; buy Fuel Ore and Organics');
writeln(' 5 : Sell Equipment and Fuel Ore; buy Organics');
writeln(' 6 : Sell Equipment and Organics; buy Fuel Ore');
writeln(' 7 : Sell all products');
writeln(' 8 : Sell fighter, shields, holds (Class 0)');
writeln;
write('Port description? ');
readln( pt );
until (0<=pt) and (pt <= 8);
space.sectors[s].portType := pt;
update := true;
end; {if else}
end;
procedure KillPort( var update : boolean );
var
s : SectorIndex;
begin
write('Remove Record for Port in which ');
s := GetSector;
if s <> 0 then
if space.sectors[s].PortType = NotAPort then
writeln( 'I have no record of ', s, ' being a port.')
else
begin
space.sectors[s].portType := NotAPort;
update := true;
end;
end;
procedure SetDock( var update : boolean );
var
sd : SectorIndex;
begin
if space.dock = 0 then
writeln('Space Dock location is not known')
else
writeln('Current space dock in sector ', space.dock );
write('Put Space Dock in which ');
sd := GetSector;
update := update or (sd <> space.dock);
space.dock := sd;
end;
procedure Unexplore( var update : boolean );
var
us : sectorIndex;
begin
write('Mark as Unexplored Which ');
us := GetSector;
if us <> 0 then
if space.sectors[ us ].number = Unexplored then
writeln( 'Sector ', us, ' is already marked as unexplored.')
else
begin
writeln('Marking ', us, ' as unexplored.');
space.sectors[ us ].number := Unexplored;
update := true;
end; {if else}
end; {unexplore}
procedure EditMenu( var update : boolean );
{ choices for direct editing the data base }
var
ch : char;
begin
repeat
repeat
writeln('Declare a sector to be a <P>ort');
writeln('Declare a sector <N>OT to be a port');
writeln('Define location of Star <D>ock');
writeln('Make sector <U>nexplored');
writeln;
writeln('<Q>uit');
writeln;
write('Your choice? ');
readln( ch );
ch := upcase( ch );
until ch in ['P', 'N', 'D', 'U', 'Q'];
case ch of
'P' : Makeport( update );
'N' : Killport( update );
'D' : setDock( update );
'U' : unexplore( update );
'Q' : ;
end; {case}
until ch = 'Q';
end; {Edit Menu}